package com.matrix.draft.dubbotest.bigdata.service.impl;

import com.matrix.draft.dubbotest.interfaces.BigDataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.Collection;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

@Slf4j
@DubboService
public class BigDataServiceImpl implements BigDataService {
    @Override
    public void ping() {
        log.debug("+++++++++ HELLO DUBBO +++++++++++");
    }

    @Override
    public Collection<String> getData(Integer n) {
        return IntStream.iterate(1, x->x+1)
                .limit(n)
                .mapToObj(i->String.valueOf(i*100))
                .collect(Collectors.toList());
    }
}
